1. Field of the Invention
The present invention is related to provide a method of block coding of an image, and specifically, a method of block encoding and decoding for applications requiring fixed length coding or parallel computation, so as to avoid complicated encoding and huge codebooks.
2. Description of the Prior Art
With rapid development of communications and computer technology, image applications are used in a diverse range. Most image applications, including video conferencing, video phoning over mobile phones or a public switched telephone network (PSTN), digital video broadcasting (DVB), etc., require high-efficiency data compression for transforming plenty of image information into packets suitable for being transmitted through narrowband channels with desirable image quality.
Image compression techniques are classified into two levels. Firstly, for video data such as continuous animation and movie dips, displaying a series of images or pictures on time domain creates motion of an object. Therefore, lower data quantity can be achieved by reducing redundancy on the time domain as well as image parts same as or similar to former image parts are not to be transmitted or to be transmitted in fewer bits. Secondly, for an image or a picture, if a pixel is same as or similar to an adjacent pixel, the pixel (or the adjacent pixel) is not to be transmitted or be transmitted in fewer bits. In other words, image compression techniques transmit redundant data of image or video contents with fewer bits, so as to reduce data quantity. In order to efficiently decrease redundant data in image or video contents while maintaining image quality, the prior art provides a block coding technique, which samples an image into units (or named blocks) each having pixels arranged as an n×m matrix, and performing operations, such as encoding, decoding, etc.
Block coding schemes are generally classified into two groups, coding in transform domain and coding in spatial domain.
In the coding in transform domain, after an image is sampled into a plurality of blocks, pixels of each block undergo time to frequency transformation by multiplying the pixels by orthogonal bases of a coordinate (or transformation coefficients), quantization, bit allocation, and entropy coding to output coded data. Among various time to frequency transformations, discrete cosine transform (DCT) is the most popular one. Computed DCT data is transformed from spatial domain to frequency domain according to visual characteristics of human eyes. For example, human eyes are less sensitive to high-frequency variations such that high-frequency parts of an image are quantized in a lager step size and low-frequency parts of an image are quantized in a smaller step size. For efficiently recording information of the low-frequency parts, the computed DCT coefficients are weighted by a quantization table followed by a zig-zag scanning and run-length coding, so as to encode the higher-frequency data by the shorter code words and the lower-frequency data by the longer code words.
In the other group, coding in spatial domain is coding each block without any transformation after an image is partitioned into a plurality of blocks. Popular methods of spatial domain coding are vector quantization (VQ) coding and differential pulse code modulation (DPCM). Take vector quantization coding for example, after an image is partitioned into a plurality of blocks, pixels of each block, from left to right and top to bottom, form a vector. Representative vectors are grouped into a codebook for encoding. The prior art has provided methods and processes of spatial domain coding.
Coding in transform domain and coding in spatial domain encode a plurality of blocks of an image. However, both of them have limitations or shortcomings. First, Coding in transform domain requires steps of bit allocation and variable length coding so that applications requiring fixed length coding or parallel computation are prohibited. On the other hand, though coding in spatial domain allows fixed length coding, a complicated encoding scheme and a huge codebook size are required as a block length increases.